<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<title>收银宝</title>
		<link rel="stylesheet" href="dist/css/layui.css" />
		<link rel="stylesheet" href="css/iconfont.css" />
		<link rel="stylesheet" href="css/shouy.css" />
		<style>
			.np_price{
			    color: #000000;
			    height: 45px;
			    border: 0;
			    width:200px;
			    border-radius: 25px;
			    background: #F0F0F0;
			    font-size: 14px;
			    line-height: 45px;
			    text-align: center;
			}
			.mui-popup-input textarea{margin-top: 5px;height: 100px; display: block; width: 90%; font-size: 14px;}
			.mui-popup-input textarea{padding: 5px;}

			.mui-popup-text{font-size: 16px; line-height: normal; padding-bottom: 5px; text-align: left;}
			.mui-popup-inner{position: relative; padding: 25px 15px 0; border-radius: 13px 13px 0 0; background: white;}
			.mui-popup {position: fixed; z-index: 10000; top: 50%; left: 50%; display: none; overflow: hidden; width: 370px; -webkit-transition-property: -webkit-transform, opacity; transition-property: transform, opacity; -webkit-transform: translate3d(-50%, -50%, 0) scale(1.185); transform: translate3d(-50%, -50%, 0) scale(1.185); text-align: center; opacity: 0; color: #000; border-radius: 13px;}
			.mui-popup.mui-popup-in {display: block; -webkit-transition-duration: 400ms; transition-duration: 400ms; -webkit-transform: translate3d(-50%, -50%, 0) scale(1); transform: translate3d(-50%, -50%, 0) scale(1); opacity: 1;}
			.mui-popup-buttons {position: relative; border-top: 1px solid #E6E6E6; display: -webkit-box; display: -webkit-flex; display: flex; height: 44px; -webkit-box-pack: center; -webkit-justify-content: center; justify-content: center;}
			.mui-popup-button {font-size: 17px; line-height: 44px; position: relative; display: block; overflow: hidden; box-sizing: border-box; width: 50%; float: left; height: 44px; padding: 0 5px; cursor: pointer; text-align: center; white-space: nowrap; text-overflow: ellipsis; color: #007aff; background: white; -webkit-box-flex: 1; *width: 46%; *float: left;}			
			.mui-popup-button:first-child {border-radius: 0 0 0 13px; border-left: 1px solid #E6E6E6;}
			.mui-popup-button:last-child {border-radius: 0 0 13px;}
			.mui-popup-button.mui-popup-button-bold {font-weight: 600;}
			.mui-popup-backdrop {position: fixed; z-index: 998; top: 0; right: 0; bottom: 0; left: 0; -webkit-transition-duration: 400ms; transition-duration: 400ms; opacity: 0; background: rgba(0, 0, 0, .4); *background: #000000; *opacity:0.9; *filter:alpha(opacity=9);}
			.mui-popup-backdrop.mui-active {opacity: 1;}
			.sy_conbox{padding-top: 0px;}
			.sy_xftop{padding:0px 0px}
			.sk_pay li{width:25%}
			.jjbbp_conbox {
				height: 73%;
				width:92.5%;
				margin-left: 20px;
			}
			.jjbbp_bt{color:#2bb6f6}
			.sy_jybtn{font-size:14px}
		</style>
	</head>

	<body>
		<div class="wrap">
			<div class="sy_header clearfix">
				<div class="sy_hleft">
					<div class="sy_logobox">
						<div class="sy_logo"><img src="img/logo-ma.png"></div>
						<p id="app_name"></p>
					</div>
				<ul class="sy_nav clearfix">
						<li>
							<a href="index.html">
								<div class="iconfont icon-shouyintai"></div>
								<p>桌台点餐</p>
							</a>
						</li>
						<li>
							<a href="reserve.html">
								<div class="iconfont icon-saomashouyin"></div>
								<p>预订管理</p>
							</a>
						</li>
						<li>
							<a href="deal_order.html">
								<div class="iconfont icon-shangpinshouyin"></div>
								<p>交易查询</p>
							</a>
						</li>
						<li>
							<a href="xiaof_member.html">
								<div class="iconfont icon-shangpinshouyin"></div>
								<p>会员管理</p>
							</a>
						</li>
						<li  class="active">
							<a href="jiaoban.html">
								<div class="iconfont icon-weibiaoti-"></div>
								<p>交班</p>
							</a>
						</li>
					</ul>
				
				</div>
				<div class="sy_hright">
					<div class="sy_shopbox">
						<div class="sy_simg"><img id="toux" src="" style="background-color: #FFFFFF;"></div>
						<div class="sy_sinfo">
							<p class="sy_snam">店名：<span id="sname"></span></p>
							<p>用户：<span id="user"></span></p>
							<p class="exit" onclick="exit()">退出登陆</p>
						</div>
					</div>
				</div>
				
			</div>
			<div class="sy_conbox clearfix">
					<div class="sy_xftop clearfix">
							<h1 style="padding: 10px;">交班明细</h4>
					</div>
			</div>
			
			<div class="jjbbp_conbox">
				<div class="jjbbp_item" style="margin-top:20px">
					<ul class="jjbbp_list clearfix">
						<li>
							<span class="bt">收营员名称：</span>
							<span class="nr" id='emp_name'> </span>
						</li>
						<li>
							<span class="bt">所属门店：</span>
							<span class="nr" id='store_name'> </span>
						</li>
						<li>
							<span class="bt">所属分组：</span>
							<span class="nr" id='group_name'></span>
						</li>
						<li style="width: 100%;">
							<span class="bt">统计时间：</span>
							<span class="nr" id='time_slot'></span>
						</li>
						<li>
							<span class="bt">订单总额/笔数：</span>
							<span class="nr" id='order'></span>
						</li>
						<li>
							<span class="bt">实收金额/笔数：</span>
							<span class="nr" id='sy'></span>
						</li>
						<li>
							<span class="bt">优惠金额：</span>
							<span class="nr" id='yh'></span>
						</li>
					</ul>
				</div>
				
				<div class="jjbbp_bt">各通道收款</div>
				<ul class="jjbbp_list clearfix sk_pay">
					<li>
						<span class="bt">支付宝：</span>
						<span class="nr" id='zfb_balance'> </span>
						<span>笔数：<em id='zfb_count'></em></span>
					</li>
					<li>
						<span class="bt">微信：</span>
						<span class="nr" id='wx_balance'></span>
						<span>笔数：<em id='wx_count'></em></span>
					</li>
				</ul>
				<ul class="jjbbp_list clearfix sk_pay">
					<li>
						<span class="bt">银联：</span>
						<span class="nr" id='yl_balance'></span>
						<span>笔数：<em id='yl_count'></em></span>
					</li>
					<li>
						<span class="bt">现金：</span>
						<span class="nr" id='xj_balance'></span>
						<span>笔数：<em id='xj_count'></em></span>
					</li>
				</ul>
				
				<div class="jjbbp_bt">会员</div>
				<ul class="jjbbp_list clearfix">
					<li>
						<span class="bt">会员充值：</span>
						<span class="nr" id='card_cz'></span>
						<span>笔数：<em id='count_cz'></em></span>
					</li>
					<li>
						<span class="bt">会员消费：</span>
						<span class="nr" id='card_xf'></span>
						<span>笔数：<em id='count_xf'></em></span>
					</li>
				</ul>
				
				<div class="jjbbp_bt">房券</div>
				<ul class="jjbbp_list clearfix">
					<li>
						<span class="bt">卡券赠送：</span>
						<span class="nr" id='fq_zs'></span>
						<span>笔数：<em id='zs_count'></em></span>
					</li>
					<li>
						<span class="bt">卡券核销：</span>
						<span class="nr" id='fq_hx'></span>
						<span>笔数：<em id='hx_count'></em></span>
					</li>
				</ul>
				
				<div class="jjbbp_bt">退款</div>
				<ul class="jjbbp_list clearfix">
					<li>
						<span class="bt">退款总金额：</span>
						<span class="nr" id='tk'></span>
						<span>笔数：<em id='count_tk'></em></span>
					</li>
				</ul>
				
				<div class="tk_bt">
					<!--<button type="button" id="tk_bun" class="sy_jybtn" >打印汇总</button>-->
					<button type="button" id="jb_bun" class="sy_jybtn" >交班并退出</button>
				</div>
			</div>
			
		</div>
	
	</body>

</html>
<script type="text/javascript" src="dist/jquery-1.11.0.min.js"></script>
<script src="dist/json2.js"></script>
<script src="dist/layui.all.js"></script>
<script type="text/javascript" src="js/app.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript">
	$(function(){
		var index = layer.load(1, {
			shade: [0.1, '#fff'] //0.1透明度的白色背景
		});
		$.ajax({
			type:'post',
			url: APP.api_url + "Index/jiaoban",
			data: {
				store_id: getValue("store_name_id"),
				id: getValue("id"),
				login_time:getValue('login_time')
			},
			success: function(data) {
				layer.close(index);
				console.log(data.emp);
				emp = data.emp;
				$('#emp_name').text(emp.name);//收银员名称
				$('#time_slot').text(emp.login_time+' ~ '+emp.now_time); //时间段
				$('#store_name').text(emp.store_name);  //门店名称
				$('#group_name').text(emp.group_name);//分组名称
				$('#order').text(emp.origin_price+'/'+emp.count_order);  //订单总额
				$('#sy').text(emp.balance+'/'+emp.count_order);  //实收金额
				$('#yh').text(emp.yh_money+'/'+emp.count_yh);  //优化金额
				$('#zfb_balance').text(emp.zfb.zfb_balance);  //支付宝
				$('#zfb_count').text(emp.zfb.zfb_count);  //支付宝笔数
				$('#xj_balance').text(emp.xj.xj_balance);  //现金金额
				$('#xj_count').text(emp.xj.xj_count);  //现金笔数
				$('#wx_balance').text(emp.wx.wx_balance);  //微信金额
				$('#wx_count').text(emp.wx.wx_count);  //微信笔数
				$('#yl_balance').text(emp.yl.yl_balance);  //银联金额
				$('#yl_count').text(emp.yl.yl_count);  //银联笔数
				$('#card_xf').text(emp.card_xf.card_xf);  //会员卡消费
				$('#count_xf').text(emp.card_xf.count_xf);  //会员卡消费笔数
				$('#card_cz').text(emp.card_cz.card_cz);  //会员卡充值
				$('#count_cz').text(emp.card_cz.count_cz);  //会员卡充值笔数
				$('#fq_zs').text(emp.fq_zs.zs_num);  //房券赠送
				$('#zs_count').text(emp.fq_zs.count_zs);  //房券赠送笔数
				$('#fq_hx').text(emp.fq_hx.hx_num);  //房券核销
				$('#hx_count').text(emp.fq_hx.count_hx);  //房券核销笔数
				$('#tk').text(emp.tk.tk);  //退款
				$('#count_tk').text(emp.tk.count_tk);  //退款
			}
		})
	});
	
	$('#jb_bun').click(function(){
		var con = layer.confirm('确认交班退出系统?', function(index) {
			$.ajax({
				type:'post',
				url: APP.api_url + "Index/end_jiaoban",
				data: {
					store_id: getValue("store_name_id"),
					id: getValue("id"),
					login_time:getValue('login_time')
				},
				success: function(data) {
					if(data.code==200){
						localStorage.clear();
						layer.close(con);
						window.location = "login.html";
					}
					
				}
			})
		});
	});
</script>